/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package planner;

import dao.BankaccountDao;
import dao.ConsumptionDao;
import dao.ContractDao;
import dao.ElectricityContractDao;
import dao.ElectricityconsumptionDao;
import dao.ExpenseDao;
import dao.IncomeDao;
import dao.InsuranceContractDao;
import dao.InsuranceconsumptionDao;
import dao.InvoiceDao;
import dao.MobileConsumptionDao;
import dao.MobileContractDao;
import dao.MortgageContractDao;
import dao.MortgageconsumptionDao;
import dao.NoteDao;
import dao.SalaryDao;
import dao.TaskDao;
import dao.UserDao;
import dao.VehiclecarDao;
import dao.WaterContractDao;
import dao.WaterconsumptionDao;
import dao.WcontractDao;
import domain.Bankaccount;
import domain.Consumption;
import domain.Contract;
import domain.Electricityconsumption;
import domain.Electricitycontract;
import domain.Expense;
import domain.Income;
import domain.Insuranceconsumption;
import domain.Insurancecontract;
import domain.Invoice;
import domain.Mobileconsumption;
import domain.Mobilecontract;
import domain.Mortgageconsumption;
import domain.Mortgagecontract;
import domain.Note;
import domain.Salary;
import domain.Task;
import domain.Userdom;
import domain.Vehiclecar;
import domain.Waterconsumption;
import domain.Watercontract;
import domain.Wcontract;
import java.util.List;
import java.util.Set;

/**
 *
 * @author Alberto
 */
public class Operations {

    public Operations() {
    }

    public Contract getContract(Integer idContract) {
        return new ContractDao().getContract(idContract);
    }

    public Income getIncome(Integer idIncome) {
        Income income = new IncomeDao().getIncome(idIncome);
        return income;
    }

    public Expense getExpense(Integer idExpense){
        Expense expense = new ExpenseDao().getExpense(idExpense);
        return expense;
    }
    
    public Userdom getUser(String user) {
        Userdom u = new UserDao().getUser(user);
        return u;
    }

    public void removeVehiclecar(Vehiclecar v) {
        new VehiclecarDao().removeVehiclecar(v);
    }

    public void updateInsuranceContract(Insurancecontract i, Contract c) {
        new ContractDao().updateContract(c);
        new InsuranceContractDao().updateInsuranceContract(i);
    }

    public void updateMobileContract(Mobilecontract m, Contract c) {
        new ContractDao().updateContract(c);
        new MobileContractDao().updateMobileContract(m);
    }

    public void updateMortgageContract(Mortgagecontract m, Contract c) {
        new ContractDao().updateContract(c);
        new MortgageContractDao().updateMortgageContract(m);
    }

    public void updateUser(Userdom u){
        new UserDao().updateUser(u);
    }

    public void updateElecContract(Electricitycontract e, Contract c){
        new ContractDao().updateContract(c);
        new ElectricityContractDao().updateElectricityContract(e);
    }

    public Task getTask(Integer idTask){
        Task task = new TaskDao().getTask(idTask);
        return task;
    }

    public Note getNote(Integer idNote){
        Note n = new NoteDao().getNote(idNote);
        return n;
    }

    public Vehiclecar getVehiclecar(Integer idCar){
        Vehiclecar v = new VehiclecarDao().getVehiclecar(idCar);
        return v;
    }

    public Bankaccount getBankAccount (Integer idB){
        Bankaccount b = new BankaccountDao().getBankaccount(idB);
        return b;
    }

    public void newBankAccount(Bankaccount b) {
        BankaccountDao bd = new BankaccountDao();
        bd.saveBankaccount(b);
    }

    public Set<Bankaccount> getBankaccountsList(Userdom u){
        return new BankaccountDao().getBankaccountList(u);
    }

    public Set<Task> getTasksList(Userdom u){
        return new TaskDao().getTaskList(u);
    }

    public Set<Note> getNotesList(Userdom u){
        return new NoteDao().getNoteList(u);
    }

    public void newElectricityConsumption(Electricityconsumption eCons) {
        new ElectricityconsumptionDao().saveElectricityconsumption(eCons);
    }

    public void newMobileConsumption(Mobileconsumption mc) {
        new MobileConsumptionDao().saveMobileconsumption(mc);
    }

    public void newMortgageConsumption(Mortgageconsumption mCons){
        new MortgageconsumptionDao().saveMortgageconsumption(mCons);
    }

    public void newInsuranceConsumption(Insuranceconsumption iCons){
        new InsuranceconsumptionDao().saveInsuranceconsumption(iCons);
    }

    public void newWaterConsumption(Waterconsumption iCons){
        new WaterconsumptionDao().saveWaterconsumption(iCons);
    }

    public void newInvoice(Invoice invoice) {
        new InvoiceDao().saveInvoice(invoice);
    }


    public void newUser(Userdom u) {
        UserDao ud = new UserDao();
        ud.saveUser(u);
    }

    public void addNote(Note note) {
        new NoteDao().saveNote(note);
    }

    public void addTask(Task task) {
        new TaskDao().saveTask(task);
    }

    public void addIncome(Income i) {
        new IncomeDao().saveIncome(i);
    }

    public void addExpense(Expense e) {
        new ExpenseDao().saveExpense(e);
    }

    public void newVehiclecar(Vehiclecar car) {
        new VehiclecarDao().saveVehiclecar(car);
    }

    public Electricitycontract getElectricityContract(Integer idCont){
        return new ElectricityContractDao().getElectricityContract(idCont);
    }

    public Mortgagecontract getMortgageContract(Integer idCont){
        return new MortgageContractDao().getMortgageContract(idCont);
    }

    public Insurancecontract getInsuranceContract(Integer idCont){
        return new InsuranceContractDao().getInsuranceContract(idCont);
    }

    public Watercontract getWaterContract (Integer idCont){
        return new WaterContractDao().getWaterContract(idCont);
    }

    public List<Electricitycontract> getElecContrList(Userdom user){
        return new ElectricityContractDao().getElecContrList(user);
    }

    public List<Mortgagecontract> getMortgageContrList(Userdom user){
        return new MortgageContractDao().getMortgageContrList(user);
    }

    public List<Insurancecontract> getInsuranceContrList(Userdom user){
        return new InsuranceContractDao().getInsContrList(user);
    }

    public List<Watercontract> getWaterContrList(Userdom user){
        return new WaterContractDao().getWaterContrList(user);
    }

    public List<Mobilecontract> getMobileContrList(Userdom user){
        return new MobileContractDao().getMobileContrList(user);
    }

    public Mobilecontract getMobileContract(Integer idCont){
        Mobilecontract m = new MobileContractDao().getMobileContract(idCont);
        return m;
    }

    public List<Mobileconsumption> getMobileconsumptionList(Mobilecontract mc){
        List<Mobileconsumption> list = new MobileConsumptionDao().getListMobileconsumption(mc);
        return list;
    }

    public List<Invoice> getInsuranceInvoiceList (Insurancecontract i){
        List<Invoice> list = new InvoiceDao().getInsuranceInvoiceList(i);
        return list;
    }

    public List<Insuranceconsumption> getInsuranceConsumptionList (Invoice i){
        return new InsuranceconsumptionDao().getInsuranceListConsumption(i);
    }

    public List<Invoice> getWaterInvoiceList (Watercontract w){
        List<Invoice> list = new InvoiceDao().getWaterInvoiceList(w);
        return list;
    }

    public List<Waterconsumption> getWaterConsumptionList (Invoice i){
        return new WaterconsumptionDao().getWaterListConsumption(i);
    }

    public List<Invoice> getMortgageInvoiceList (Mortgagecontract m){
        List<Invoice> list = new InvoiceDao().getMortgageInvoiceList(m);
        return list;
    }

    public List<Mortgageconsumption> getMortgageConsumptionList (Invoice i){
        return new MortgageconsumptionDao().getMortgageListConsumption(i);
    }

    public List<Invoice> getElectricityInvoiceList (Electricitycontract e){
        List<Invoice> list = new InvoiceDao().getElectricityInvoiceList(e);
        return list;
    }

    public List<Electricityconsumption> getElectricityConsumptionList (Invoice i){
        return new ElectricityconsumptionDao().getElectricityListConsumption(i);
    }

    public void removeIncome(Income income) {
        new IncomeDao().removeIncome(income);
    }

    public void removeExpense(Expense expense){
        new ExpenseDao().removeExpense(expense);
    }

    public void removeTask(Task task) {
        new TaskDao().removeTask(task);
    }

    public void removeNote(Note n) {
        new NoteDao().removeNote(n);
    }

    public void removeElectricityContract(Electricitycontract e) {
        new ElectricityContractDao().removeElectricityContract(e);
    }

    public void removeElectricityConsumption(Electricityconsumption e){
        new ElectricityconsumptionDao().removeElectricityconsumption(e);
    }

    public void removeMortgageContract(Mortgagecontract c){
        new MortgageContractDao().removeMortgageContract(c);
    }

    public void removeMortgageConsumption (Mortgageconsumption m){
        new MortgageconsumptionDao().removeMortgageconsumption(m);
    }

    public void removeInsuranceContract(Insurancecontract i) {
        new InsuranceContractDao().removeInsuranceContract(i);
    }

    public void removeInsuranceConsumption (Insuranceconsumption i){
        new InsuranceconsumptionDao().removeInsuranceconsumption(i);
    }

    public void removeWaterContract(Watercontract w){
        new WaterContractDao().removeWaterContract(w);
    }

    public void removeWaterConsumption (Waterconsumption w){
        new WaterconsumptionDao().removeWaterconsumption(w);
    }

    public void removeMobileContract (Mobilecontract m){
        new MobileContractDao().removeMobileContract(m);
    }

    public void removeMobileConsumption (Mobileconsumption m){
        new MobileConsumptionDao().removeMobileconsumption(m);
    }

    public void removeConsumption (Consumption c){
        new ConsumptionDao().removeConsumption(c);
    }

    public void removeInvoice (Invoice i){
        new InvoiceDao().removeInvoice(i);
    }

    public void removeContract(Contract w) {
        new ContractDao().removeContract(w);
    }

    public void removeBankaccount (Bankaccount b){
        new BankaccountDao().removeBankaccount(b);
    }

    public void newWaterContract(Watercontract w, Contract c) {
        new ContractDao().saveContract(c);
        new WaterContractDao().saveWaterContract(w);
    }

    public void newMortgageContract(Mortgagecontract m, Contract c){
        new ContractDao().saveContract(c);
        new MortgageContractDao().saveMortgageContract(m);
    }

    public void newInsuranceContract(Insurancecontract i, Contract c){
        new ContractDao().saveContract(c);
        new InsuranceContractDao().saveInsuranceContract(i);
    }

    public void newMobileContract (Mobilecontract m, Contract c){
        new ContractDao().saveContract(c);
        new MobileContractDao().saveMobileContract(m);
    }

    public void newElectricityContract (Electricitycontract e, Contract c) {
        new ContractDao().saveContract(c);
        new ElectricityContractDao().saveElectricityContract(e);
    }

    public void newConsumption(Consumption c){
        new ConsumptionDao().saveConsumption(c);
    }

    public Mobileconsumption getMobileconsumptionDate(Mobilecontract m){
        Mobileconsumption mc = new MobileConsumptionDao().getMobileconsumptionDate(m);
        return mc;
    }

    public List<Mobileconsumption> getListMobileconsumptionDate3(Mobilecontract m){
        List<Mobileconsumption> list = new MobileConsumptionDao().getListMobileconsumptionDate3(m);
        return list;
    }

    public List<Mobileconsumption> getListMobileconsumptionDate6(Mobilecontract m){
        List<Mobileconsumption> list = new MobileConsumptionDao().getListMobileconsumptionDate6(m);
        return list;
    }

    public Set getInvoiceList(Bankaccount b){
        Set list = new InvoiceDao().getInvoiceBankFK(b);
        return list;
    }

    public Wcontract getWcontract(Integer idWcontract) {
        return new WcontractDao().getWcontract(idWcontract);
    }

    public void newWContract(Wcontract w) {
        new WcontractDao().saveWContract(w);
    }

    public void removeWcontract(Wcontract w) {
        new WcontractDao().removeWcontract(w);
    }

    public List<Wcontract> getWContrList(Userdom user) {
        return new WcontractDao().getWContrList(user);
    }

    public Mobileconsumption getLastMobileconsumption(Mobilecontract mc){
        Mobileconsumption m = new MobileConsumptionDao().getLastMobileConsumption(mc);
        return m;
    }

    public Electricityconsumption getLastElecConsumption(Electricitycontract e){
        Electricityconsumption eCons = new ElectricityconsumptionDao().getElectricityconsumptionDate(e);
        return eCons;
    }

    public Insuranceconsumption getLastInsConsumption(Insurancecontract e){
        Insuranceconsumption iCons = new InsuranceconsumptionDao().getInsuranceconsumptionDate(e);
        return iCons;
    }

    public Mortgageconsumption getLastMortgConsumption(Mortgagecontract e){
        Mortgageconsumption mCons = new MortgageconsumptionDao().getMortgageconsumptionDate(e);
        return mCons;
    }

    public Waterconsumption getLastWaterConsumption(Watercontract e){
        Waterconsumption wCons = new WaterconsumptionDao().getWaterconsumptionDate(e);
        return wCons;
    }

    public void newSalary(Salary s){
        new SalaryDao().saveSalary(s);
    }

    public List<Vehiclecar> getListVehiclecar(Userdom user){
        List<Vehiclecar> list = new VehiclecarDao().getListVehiclecar(user);
        return list;
    }

    public Salary getSalaryDate(Wcontract c){
        Salary s = new SalaryDao().getSalaryDate(c);
        return s;
    }

    public void updateVehiclecar(Vehiclecar v){
        new VehiclecarDao().updateVehiclecar(v);
    }

    public void updateWContract(Wcontract wc) {
        new WcontractDao().updateWContract(wc);
    }

    public void updateWaterContract(Watercontract w, Contract c) {
        new ContractDao().updateContract(c);
        new WaterContractDao().updateWaterContract(w);
    }

    public void updateBankAccount(Bankaccount b) {
        new BankaccountDao().updateBankAccount(b);
    }

    public List<Salary> getListSalary(Bankaccount b){
        return new SalaryDao().getListSalary(b);
    }
}

